package com.learn;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class App {
    public static void main( String[] args ){
        //ConfigurableApplicationContext context = SpringApplication.run(App.class, args);
    	SpringApplication app = new SpringApplication(App.class);
    	app.setAdditionalProfiles("pro");//使用pro环境
    	ConfigurableApplicationContext context = app.run(args);
        System.out.println(context.getEnvironment().getProperty("local.ip"));
        System.out.println(context.getEnvironment().getProperty("springboot.name"));//com.learn.MyEnvironmentPostProcessor
        context.getBean(UserConfige.class).show();
        context.getBean(JdbcConfig.class).show();
        context.getBean(DatasourcesProperties.class).show();
        System.out.println(context.getBean(ListArrayConfig.class));
        context.close();
    }
}